#import <Foundation/Foundation.h>
#include "Task.h"
#import "DataManager.h"

@interface TracDataManager : NSObject {
	
@private
	NSMutableArray *userTasks;
	Task *currentTask;
	NSDictionary *userTasksByName;
	NSInteger currentTaskIndex;
}

+ (TracDataManager *)sharedTracDataManager;

@property (nonatomic) NSInteger currentTaskIndex;
@property (retain) Task *currentTask;
@property (retain) NSMutableArray *userTasks;
@property (retain) NSDictionary *userTasksByName;
#pragma mark Task List

- (NSDictionary *)userTasksByName;

#pragma mark Task
- (NSInteger *)countOfTasks;
- (Task *)taskAtIndex:(NSUInteger)theIndex;
- (NSInteger)indexForTaskid:(NSString *)taskId hostName:(NSString *)hostname; 
- (void)makeTaskAtIndexCurrent:(NSUInteger)theIndex;
- (void)makeNewTaskCurrent;
- (void)saveCurrentTask;
- (void)removeCurrentTask;
- (void)syncTasksForUser:(id)userID;
- (void)saveTaskData;
- (void)resetCurrentTask;
- (BOOL)saveTask:(Task *)aTask;
- (BOOL)doesTaskExists:(Task *)aTask;

#pragma mark Utils

@end
